// 二叉树相关算法
#include "./model/binary-tree.h"

int main()
{
	int nodes[] = {(int)'c', (int)'a', (int)'d', (int)'z', (int)'x', (int)'q', (int)'e', (int)'g', (int)'i', (int)'j', (int)'b', (int)'l'};
	BinaryTree tree = createSortTree(nodes, 12);
	printf("先序遍历：");
	preorderTraverse(tree);
	printf("\n");
	printf("中序遍历：");
	inorderTraverse(tree);
	printf("\n");
	printf("后序遍历：");
	postorderTraverse(tree);
	printf("\n");
	printf("层次遍历：");
	hierarchicalTraverse(tree);
	printf("\n");
	printf("二叉树节点数：%d\n", nodeCount(tree));
	printf("二叉树叶子节点数：%d\n", leafCount(tree));
	printf("二叉树单分支节点数：%d\n", singleBranchCount(tree));
	printf("二叉树双分支节点数：%d\n", doubleBranchCount(tree));
	printf("二叉树根节点子孙数：%d\n", childCount(tree));
	printf("二叉树高度：%d\n", treeHeight(tree));
	printf("二叉树宽度：%d\n", treeWidth(tree));
	return 0;
}